import jsonp from 'common/js/jsonp'
import {commonParams,	options,	ophttp} from './config'
import axios from 'axios';

export function getSingerList() {
  const url = 'https://c.y.qq.com/v8/fcg-bin/v8.fcg'

  const data = Object.assign({}, commonParams, {
    channel: 'singer',
    page: 'list',
    key: 'all_all_all',
    pagesize: 100,
    pagenum: 1,
    hostUin: 0,
    needNewCode: 0,
    platform: 'yqq'
  })

  return jsonp(url, data, options)
}

export function getSingerDetail(singerId) {//获取歌手详情
  const url = 'https://c.y.qq.com/v8/fcg-bin/fcg_v8_singer_track_cp.fcg'

  const data = Object.assign({}, commonParams, {
    hostUin: 0,
    needNewCode: 0,
    platform: 'yqq',
    order: 'listen',
    begin: 0,
    num: 100,
    songstatus: 1,
    singermid: singerId
  })

  return jsonp(url, data, options)
}

//歌手详情页
export function VoCalist(id,mus) {//获取歌手详情
	 if(mus==1){
			const url=ophttp+`search?key=579621905&s=${id}&limit=100&offset=0&type=song`
			return url
	 }else if(mus==2){
		 const url=ophttp+`songList?key=579621905&id=${id}`
		 return url
	 }else if(mus==3){ //音乐详情
		 const url=ophttp+`song?key=579621905&id=${id}`
		 return url
	 }
}

